<template>
  <div id="app">
    <van-nav-bar
      title="接口版列表跳详情"
      left-text="返回"
      left-arrow
      @click-left="goback"
    />
    <router-view />
    <van-tabbar route>
      <van-tabbar-item icon="home-o" to="/">首页</van-tabbar-item>
      <van-tabbar-item icon="user-o" to="/my">会员</van-tabbar-item>
      <van-tabbar-item icon="cart-o" to="/shopcar">购物车</van-tabbar-item>
      <van-tabbar-item icon="search" to="/search">搜索</van-tabbar-item>
    </van-tabbar>
    <!-- 开启路由模式 加上route属性 to属性代表要跳转的页面 -->
  </div>
</template>
<script>
export default {
  methods: {
    goback() {
      this.$router.go(-1);
      //回到 上一页
    },
  },
};
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
